From ffebfccdb083011ec966de45b726f5d6708105e9 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Wed, 17 Jul 2013 01:30:52 +0000 Subject: [PATCH] Modification of the round() workaround for MSVC, defining in defs.h instead of lowrance*.cc git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4441 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/defs.h | 7 +++++++ gpsbabel/lowranceusr.cc | 5 ----- gpsbabel/lowranceusr4.cc | 5 ----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index c426f5a3e..17361a9f8 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -1037,6 +1037,13 @@ char* rot13(const QString& str); signed int si_round(double d); +#if _MSC_VER +//These functions are not included in the MS pre C99 implementation, use internal implementation +//This asssumes that non-_MSC_VER includes math.h (all should include defs.h) +#define round si_round +#define lround si_round +#endif + /* * Data types for Palm/OS files. */ diff --git a/gpsbabel/lowranceusr.cc b/gpsbabel/lowranceusr.cc index 3171a255b..0c1685b5d 100644 --- a/gpsbabel/lowranceusr.cc +++ b/gpsbabel/lowranceusr.cc @@ -36,11 +36,6 @@ #include #include /* for lat/lon conversion */ -#if defined(_MSC_VER) -//Incomplete implementation, use existing GB function -#define lround si_round -#endif - typedef struct lowranceusr_icon_mapping { const int value; const char* icon; diff --git a/gpsbabel/lowranceusr4.cc b/gpsbabel/lowranceusr4.cc index 6f26cca10..db8ccfaa3 100644 --- a/gpsbabel/lowranceusr4.cc +++ b/gpsbabel/lowranceusr4.cc @@ -30,11 +30,6 @@ #include /* for lat/lon conversion */ #include /* for gmtime */ -#if defined(_MSC_VER) -//Incomplete implementation, use existing GB function -#define round si_round -#endif - /* from waypt.c, we need to iterate over waypoints when extracting routes */ extern queue waypt_head; -- 2.30.2